package com.xbongbong.parent.interfaces;

import com.xbongbong.paas.domain.entity.ext.ConditionsEntityExt;
import com.xbongbong.paas.domain.entity.ext.PaasFormDataEntityExt;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.pojo.ButtonPojo;
import com.xbongbong.paas.pojo.dto.ColumnSetListDTO;
import com.xbongbong.paas.pojo.dto.FormDataListDTO;
import com.xbongbong.paas.pojo.vo.PaasFormDataEsListVO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.parent.pojo.list.ConditionListPojo;
import com.xbongbong.parent.pojo.list.ConditionListResultPoJo;
import com.xbongbong.parent.pojo.list.DataAnalysisListPojo;
import com.xbongbong.parent.pojo.list.FieldListPojo;
import com.xbongbong.parent.pojo.list.PermissionListPojo;
import com.xbongbong.pro.applist.pojo.AppListPojo;
import com.xbongbong.pro.applist.pojo.vo.ListAppVO;
import com.xbongbong.pro.formexplain.pojo.HandleExplainPojo;

import java.util.List;

/**
 * 此类主要提供业务层列表（列表包含pc端列表，手机端列表，导出列表）渲染方法（包括字段解析，手机端还包含了标题拼装，标签摘要拼装）
 * @author 吴峰
 * @date 2021/12/15 17:22
 */
public interface BusinessListService {
    /**
     * 列表通用方法封装，即手机端，pc端，导出
     * @param formDataListDTO
     * @return
     * @throws XbbException
     */
    PaasFormDataEsListVO list(FormDataListDTO formDataListDTO) throws XbbException;

    /**
     * 手机端列表方法封装
     * @param formDataListDTO
     * @return
     * @throws XbbException
     */
    ListAppVO dingtalkList(FormDataListDTO formDataListDTO) throws XbbException;
    /**
     * web端列表方法
     * @param formDataListDTO
     * @return
     * @throws XbbException
     */
    PaasFormDataEsListVO webList(FormDataListDTO formDataListDTO) throws XbbException;



    /**
     * 业务类型
     * @return
     */
    List<Integer> businessType();


    /**
     * 获取业务所需权限，包括负责人团队权限
     * @param permissionListPojo
     * @return List<ConditionsEntityExt>
     * @author 吴峰
     * @date 2021/12/15 19:10
     * @throws XbbException
     */
    List<ConditionsEntityExt> getPermission(PermissionListPojo permissionListPojo) throws XbbException;

    /**
     * 拼装条件
     * @param conditionListPojo
     * @return List<ConditionsEntityExt>
     * @author 吴峰
     * @date 2021/12/15 19:10
     * @throws XbbException
     */
    ConditionListResultPoJo getCondition(ConditionListPojo conditionListPojo) throws XbbException;

    /**
     * 拼装条件
     * @param conditionListPojo
     * @return List<ConditionsEntityExt>
     * @author 吴峰
     * @date 2021/12/15 19:10
     * @throws XbbException
     */
    ConditionListResultPoJo mobileGetCondition(ConditionListPojo conditionListPojo) throws XbbException;

    /**
     * web端处理列表页特殊筛选 实现于com.xbongbong.saas.help.SaasListHelp.commonFilter
     * @param conditionListPojo
     * @return
     * @throws XbbException
     */
    List<ConditionsEntityExt> webCommonFilter(ConditionListPojo conditionListPojo) throws XbbException;

    /**
     * 获取解释
     * 此方法将字段解释的变动更改都会在此方法处理，包括：com.xbongbong.saas.help.SaasListHelp#handelSaasSpecialList(java.util.List, java.lang.Integer, java.lang.Integer)
     * @param fieldListPojo
     * @return HandleExplainPojo
     * @author 吴峰
     * @date 2021/12/16 11:30
     * @throws XbbException
     */
    HandleExplainPojo getExplain(FieldListPojo fieldListPojo) throws XbbException;

    /**
     * 字段排序
     * @param formDataListDTO
     * @throws XbbException
     */
    void setSortMap(FormDataListDTO formDataListDTO) throws XbbException;

    /**
     * web 端解析数据
     * @param dataAnalysisListPojo
     * @return PaasFormDataEsListVO
     * @author 吴峰
     * @date 2021/12/16 13:49
     * @throws XbbException
     */
     List<PaasFormDataEntityExt> webDataAnalysis(DataAnalysisListPojo dataAnalysisListPojo) throws XbbException;


    /**
     * 手机 端解析数据
     * @param dataAnalysisListPojo
     * @return PaasFormDataEsListVO
     * @author 吴峰
     * @date 2021/12/16 13:49
     * @throws XbbException
     */
    List<PaasFormDataEntityExt> dingtalkDataAnalysis(DataAnalysisListPojo dataAnalysisListPojo) throws XbbException;

    /**
     * 冻结列
     * @param columnSetListDTO
     * @param list
     * @throws XbbException
     */
    void setFixedAndInvisible(ColumnSetListDTO columnSetListDTO, List<FieldAttrEntity> list) throws XbbException;

    /**
     * 字段排序
     * @param columnSetListDTO
     * @param list
     * @throws XbbException
     */
    void explainFieldSort(ColumnSetListDTO columnSetListDTO, List<FieldAttrEntity> list) throws XbbException;
    /**
     * 手机端-操作
     * @param dataAnalysisListPojo
     * @return
     * @throws XbbException
     */
    List<AppListPojo> dingtalkOperate(DataAnalysisListPojo dataAnalysisListPojo) throws XbbException;
     /**
      * web端增加操作
      * @param dataAnalysisListPojo
      * @return void
      * @author 吴峰
      * @date 2021/12/20 16:16
      * @throws XbbException
      */
     void webOperate(DataAnalysisListPojo dataAnalysisListPojo) throws XbbException;
    /**
     * 顶部按钮
     * -》com.xbongbong.paas.help.FormDataListSearchHelp#getTopAndButtonList(com.xbongbong.paas.pojo.dto.FormDataListDTO, java.lang.String, java.lang.Integer, java.util.List, java.util.List, com.xbongbong.paas.domain.entity.ext.PaasFormEntityExt, java.util.List)
     * @param formDataListDTO
     * @return java.util.List<com.xbongbong.paas.pojo.ButtonPojo>
     * @author 吴峰
     * @date 2021/12/18 14:18
     * @throws XbbException
     */
    List<ButtonPojo> topButton(FormDataListDTO formDataListDTO) throws XbbException;
     /**
      * 底部按钮
      * -》com.xbongbong.paas.help.FormDataListSearchHelp#getTopAndButtonList(com.xbongbong.paas.pojo.dto.FormDataListDTO, java.lang.String, java.lang.Integer, java.util.List, java.util.List, com.xbongbong.paas.domain.entity.ext.PaasFormEntityExt, java.util.List)
      * @param formDataListDTO
      * @return java.util.List<com.xbongbong.paas.pojo.ButtonPojo>
      * @author 吴峰
      * @date 2021/12/18 14:18
      * @throws XbbException
      */
     List<ButtonPojo> bottomButton(FormDataListDTO formDataListDTO, List<FieldAttrEntity> explainList) throws XbbException;


}
